#include "ExitCommand.h"
#include "MainWindow.h"
#include <QMessageBox>
#include <QObject>
#include <QApplication>

ExitCommand::ExitCommand(MainWindow* mainWindow) 
	: mainWindow_(mainWindow)
{}

ExitCommand::~ExitCommand() {}

void ExitCommand::execute()
{
	if (QMessageBox::question(mainWindow_,
			       	QObject::tr("Stock"), 
				QObject::tr("Do you really want to quit?"),
				QMessageBox::Yes|QMessageBox::No) 
			== QMessageBox::Yes)
			QApplication::exit();
}
